package demo02;

public class Fund {
    Stock1 stock1;
    Stock2 stock2;
    Stock3 stock3;
    Stock4 stock4;

    public Fund() {
        stock1=new Stock1();
        stock2=new Stock2();
        stock3=new Stock3();
        stock4=new Stock4();
    }
    public void method1(){
        System.out.println("method1: ");
        stock1.buy();
        stock2.buy();
    }

    public void method2(){
        System.out.println("method2: ");
        stock1.buy();
        stock2.sell();
    }
}
